package com.lansea.wms.model.base;


import com.lansea.wms.entity.SerializeBase;
import com.lansea.wms.service.UserService;
import com.lansea.wms.util.DateUtil;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.stereotype.Component;

import java.util.Date;
@Data
@Component
public class BaseUser extends SerializeBase {

    private Integer createUid;
    private Integer updateUid;

    @DateTimeFormat(pattern = DateUtil.DATE_TIME_FORMAT)
    private Date createTime;

    @DateTimeFormat(pattern = DateUtil.DATE_TIME_FORMAT)
    private Date updateTime;

    private String createUserName;
    private String updateUserName;


    public void setCreateUidToLoginUser(UserService userService) {
        setCreateUid(userService.getLoginUser().getId());
    }

    public void setUpdateUidToLoginUser(UserService userService) {
        setUpdateUid(userService.getLoginUser().getId());
    }




}
